<?php
include_once ROOT_DIR."/bc/block.demo.php";
/**
 * 字段有:
 * 	id
 * 	
 */
//对{demo } ... {/demo }的解析
function smarty_block_demo (&$params, $content, &$smarty, &$repeat){
   return $smarty->callblockfunc($params,$content,$smarty,$repeat, getdemo);
}

/**
 * 参数：
 * 	
 * @param unknown_type $params
 */
function getdemo(&$params) {
	$table = "t_demo";
	$tprefix = "$table.c_";
	
	//#region 构建sql条件语句
	$sqlwhere = "1=1 ";
	
	if(!isempty(@$params["name"])){
		$v = str_replace("*", "%", $params["name"]);
		$sqlwhere .= " and {$tprefix}name like '$v' ";
	}
	
//	if(!isempty(@$params["cid"])){
//		$sqlwhere .= " and {$tprefix}cid = '$params[cid]' ";
//	}
	
	//#endreg 构建sql条件语句
	
	return getcommbc("demo", $params, null, null, $sqlwhere);
}
?>